package com.tianzeculture.stagebao.activity.personal;

import android.content.Intent;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.tianzeculture.stagebao.R;
import com.tianzeculture.stagebao.base.BaseActivity;
import com.tianzeculture.stagebao.network.enity.MSG;
import com.tianzeculture.stagebao.util.StatusBarUtil;
import com.tianzeculture.stagebao.util.Util;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/6/20 0020.
 * 修改名称
 */

public class EditNickNameActivity extends BaseActivity {
    @BindView(R.id.tvTitle)
    TextView tvTitle;
    @BindView(R.id.tvRight)
    TextView tvRight;
    @BindView(R.id.edtNickName)
    EditText edtNickName;

    @Override
    public void initUI() {
        super.initUI();
        StatusBarUtil.setWindowStatusBarColor(this, R.color.colorGray_F8);
        tvTitle.setText("更改昵称");
        tvRight.setVisibility(View.VISIBLE);
    }

    @OnClick(R.id.tvRight)
    public void SaveNickName(View view) {
        if (!"".equals(edtNickName.getText().toString().trim())) {
            Intent intent = getIntent();
            intent.putExtra("NICKNAME", edtNickName.getText().toString().trim());
            setResult(Util.CHOOSE_NICKNAME, intent);
            finish();
        }
    }

    @Override
    public void refreshUI(int taskId, MSG msg) {
        super.refreshUI(taskId, msg);
    }

    @Override
    protected int getLayoutResID() {
        return R.layout.activity_edit_nickname;
    }
}
